package com.show.service.impl;

import com.show.mapper.BaseMapper;
import com.show.mapper.SpecialtyMapper;
import com.show.service.SpecialtyService;
import com.show.utils.SqlSessionFactoryUtils;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;

import java.util.List;
import java.util.Map;

/**
 * @author 绛河
 */
public class SpecialtyServiceImpl implements SpecialtyService {
    SqlSessionFactory factory = SqlSessionFactoryUtils.getSqlSessionFactory();
    @Override
    public List<Map<String, Object>> searchTop() {
        SqlSession sqlSession = factory.openSession();
        SpecialtyMapper mapper = sqlSession.getMapper(SpecialtyMapper.class);
        List<Map<String, Object>> maps = mapper.searchTop();
        return maps;
    }
}
